import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

public class Exercise1 {
    public static void main(String[] args){
        HashSet<Integer> output=new HashSet<>();
        ArrayList<ArrayList<Integer>> results=new ArrayList<>();
        Scanner scanner=new Scanner(System.in);
        System.out.print("Enter n:");
        int n= scanner.nextInt();
        for (int i = 0; i < fact(n); i++) {
            while (true) {
                ArrayList<Integer> integers = new ArrayList<>();
                ArrayList<Integer> temp = new ArrayList<>();
                SecureRandom num = new SecureRandom();
                for (int j = 0; j < n; j++) {
                    integers.add(j + 1);
                }
                for (int j = 0; j < n; j++) {
                    int ran = num.nextInt(integers.size());
                    temp.add(integers.get(ran));
                    integers.remove(ran);
                }
                    if(results.contains(temp)){
                        continue;
                    }
                results.add(temp);
                break;
            }
        }
        for (ArrayList<Integer> a:results){
                int num = 0;
                for (int b : a) {
                    int i = 1;
                    num += Math.abs(b - i);
                }
                output.add(num);
        }
        System.out.println(output.size());
    }
    public static int fact(int n){
        int result=1;
        while (n>1){
            result*=n;
            n--;
        }
        return result;
    }
}